package com.paradox.aggregation.provider.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Configuration
public class ConfigTests {

    @Bean
    public Test test(){
        return new Test(1);
    }

    class Test{
        private int x;

        public Test(int x){
            this.x=x;
        }

        @PostConstruct
        public void postConstruct(){
            Runtime.getRuntime().addShutdownHook(new Thread(() -> {
                System.out.println("shutdown gracefully");
            }));

        }
    }
}
